﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace LiveEduWizard.Views
{
    public partial class AboutPanel : PhoneApplicationPage
    {
        public AboutPanel()
        {
            InitializeComponent();
            InitApplicationBar();
        }

        private void InitApplicationBar()
        {
            ApplicationBar = new ApplicationBar();
            ApplicationBar.Mode = ApplicationBarMode.Default;
            ApplicationBar.IsVisible = true;
            ApplicationBar.IsMenuEnabled = true;
            InitApplicationBarButtons();
        }

        private void InitApplicationBarButtons()
        {
            ApplicationBarIconButton backButton = new ApplicationBarIconButton(new
                Uri(ThemeHelper.IsLightTheme ? "Images/back_button_black.png" : "Images/back_button_white.png", UriKind.Relative));
            backButton.Text = "back";
            backButton.Click += new EventHandler(backButton_Click);
            ApplicationBar.Buttons.Add(backButton);
        }

        void backButton_Click(object sender, EventArgs e)
        {
            NavigationService.GoBack();
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            Browser.Source = new Uri("http://galileoschool.edupage.org");
        }        
    }
}